<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/webpage/include/taglib.jsp"%>
<!DOCTYPE html>
<html data-dpr="1">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="${ctxStatic }/backend/css/css.css">
    <script src="${ctxStatic }/backend/js/jquery-1.8.3.min.js"></script>
    <script src="${ctxStatic }/plugin/layui/layer/layer.js"></script>
    <script type="text/javascript">
    	function prev(){
    		var pageNo;
    		var now = Number($("#now").text());
    		if(now == 1){
    			layer.msg("已经是第一页了");
    			return;
    		}else{
    			pageNo = now-1;
    			$.ajax({
    				url:'${ctx}/back/getTodayOrders',
    				data:{
    					"pageNo":pageNo
    				},
    				type:'POST',
    				dataType:'json',
    				success:function(obj){
    					var $list = obj.body.data.list;
    					$(".xxsj").empty();
    					$.each($list,function(index,item){
    						console.log(item);
    						var data = '<li>'+
    									'<div class = "nr">'+
    									'<h1>'+item.ordersNo+'</h1>'+
    									'<p>'+item.ordersName+'</p>'+
    									'</div>'+
    									'<div class = "nr">'+
    									'<h1>'+item.member.loginName+'</h1>'+
    									'</div>'+
    									'<div class = "nr">'+
    									'<span><em>¥</em>'+item.money+'</span>'+
    									'</div>'+
    									'<div class = "nr">'+
    									'<h1>'+item.createDate+'</h1>'+
    									'</div>'+
    									'<div class = "clear"></div>'+
    									'</li>';
    						$(".xxsj").append(data);
    						$("#now").text(pageNo);
    					});
    				}
    			});
    		}
    	}
    	function next(){
    		var pageNo;
    		var now = Number($("#now").text());
    		var last = Number($("#last").text());
    		console.log(now);
    		console.log(last);
    		if(now == last){
    			layer.msg("已经是最后一页了");
    			return;
    		}else{
    			pageNo = now + 1;
    			$.ajax({
    				url:'${ctx}/back/getTodayOrders',
    				data:{
    					"pageNo":pageNo
    				},
    				type:'POST',
    				dataType:'json',
    				success:function(obj){
    					var $list = obj.body.data.list;
    					$(".xxsj").empty();
    					$.each($list,function(index,item){
    						console.log(item);
    						var data = '<li>'+
    									'<div class = "nr">'+
    									'<h1>'+item.ordersNo+'</h1>'+
    									'<p>'+item.ordersName+'</p>'+
    									'</div>'+
    									'<div class = "nr">'+
    									'<h1>'+item.member.loginName+'</h1>'+
    									'</div>'+
    									'<div class = "nr">'+
    									'<span><em>¥</em>'+item.money+'</span>'+
    									'</div>'+
    									'<div class = "nr">'+
    									'<h1>'+item.createDate+'</h1>'+
    									'</div>'+
    									'<div class = "clear"></div>'+
    									'</li>';
    						$(".xxsj").append(data);
    						$("#now").text(pageNo);
    					});
    				}
    			});
    		}
    	}
    </script>

</head>
<body class="htbg">
    <div class="hd-nrq">
        <div class="hdnr-fl">
            <ul class="lmkj">
                <li class="xm1">
                    <span>今日认购额</span>
                    <h1>¥${todayBuy }</h1>
                    
                </li>
                <li class="xm2">
                    <span>今日新增人数</span>
                    <h1>${todayStatic }</h1>
                    
                </li>
                <li class="xm3">
                    <span>今日发放奖励</span>
                    <h1>¥${todayDynamic }</h1>
                    
                </li>
                <li class="xm4">
                    <span>今日成交额</span>
                    <h1>¥${todayCost }</h1>
                    
                </li>
                <li class="xm4">
                    <span>总认购额</span>
                    <h1>¥${totalBuy }</h1>

                </li>
                <li class="xm4">
                    <span>平台积分</span>
                    <h1>¥${totalIntegral }</h1>

                </li>


                <div class="clear"></div>
            </ul>
            <div class="lmnr">
                <div class="lmxq xqzs lm1">
                   <div class="lmbt">
                        <div class="fl">
                            <h1>今日认购明细</h1>
                            <span>${page.count }条记录</span>
                        </div>
                   </div>
                    <ul class="lmxqnr">
                        <li><span>认购商品</span></li>
                        <li><span>用户</span></li>
                        <li><span>支付金额</span></li>
                        <li><span>日期</span></li>
                    </ul>
                    <ul class="xxsj">
                        <c:forEach items = "${page.list }" var = "subRecord">
                        <li>
                            <div class="nr">
                                <h1>${subRecord.goodsName }</h1>
<%--                                <p>${orders.ordersName }</p>--%>
                            </div>
                            <div class="nr">
                                <h1>${subRecord.member.loginName }</h1>
                            </div>
                            <div class="nr">
                                <span><em>¥</em>${subRecord.totalPrice }</span>
                            </div>
                            <div class="nr">
                                <h1><fmt:formatDate value = "${subRecord.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/></h1>
                            </div>
                            <div class="clear"></div>
                        </li>
                        </c:forEach>
                    </ul>
                    <div class="fanye">
                        <a onclick = "prev()" class="left"><img src="${ctxStatic }/backend/images/left.png"></a>
                        <p><span id = "now">${page.pageNo }</span>/<span id = "last">${page.last }</span></p>
                        <a onclick = "next()" class="right"><img src="${ctxStatic }/backend/images/right.png"></a>
                    </div>
                </div>
                
                
            </div>
        </div>
        <%--<div class="hdnr-fr">--%>
            <%----%>
            <%--<div class="zsnr">--%>
                <%--<div class="fl">--%>
                    <%--<h1>¥${totalBuy }</h1>--%>
                    <%--<p>总认购额</p>--%>
                <%--</div>--%>
                <%--<div class="fr">--%>
                    <%--<img src="${ctxStatic }/backend/images/zs2.png">--%>
                <%--</div>--%>
                <%--<div class="clear"></div>--%>
            <%--</div>--%>
            <%--<div class="zsnr">--%>
                <%--<div class="fl">--%>
                    <%--<h1>¥${totalStatic }</h1>--%>
                    <%--<p>总静态分红</p>--%>
                <%--</div>--%>
                <%--<div class="fr">--%>
                    <%--<img src="${ctxStatic }/backend/images/zs3.png">--%>
                <%--</div>--%>
            <%--</div>--%>
            <%--<div class="clear"></div>--%>
        <%--</div>--%>
        <div class="clear"></div>
    </div>

</body>
</html>